package com.towker.core.log;

import com.towker.core.util.UniqueId;

public  class BaseException extends Exception
{
	
	public BaseException()
	{}
	
	/**
	 * 构造函数
	 * @param executor 执行人
	 * @param type 日志类别
	 * @param content 日志内容
	 */
	public BaseException(String executor,String type,String content)
	{ 
		this.executor=executor;
		this.type=type;
		this.content=content;
	}
	
	/**
	 * 构造函数
	 * @param executor 系统ID
	 * @param executor 执行人
	 * @param type 日志类别
	 * @param content 日志内容
	 */
	public BaseException(long systemId,String executor,String type,String content)
	{
		this.systemId=systemId;
		this.executor=executor;
		this.type=type;
		this.content=content;
	}
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * 执行人
	 */
	private String  executor="SYSTEM";
	/**
	 * 日志类型
	 */
	private String type="";
	
	/**
	 * 内容
	 */
	private String content="";
	
	/**
	 * 系统ID
	 */
	private long systemId=0;
	
	

	public String getExecutor() {
		return executor;
	}



	public void setExecutor(String executor) {
		this.executor = executor;
	}



	public String getType() {
		return type;
	}



	public void setType(String type) {
		this.type = type;
	}



	public String getContent() {
		return content;
	}



	public void setContent(String content) {
		this.content = content;
	}



	public long getSystemId() {
		return systemId;
	}



	public void setSystemId(long systemId) {
		this.systemId = systemId;
	}



	@Override
	public String toString()
	{
		StringBuffer buf = new StringBuffer();
		buf.append("<");
		try {
			buf.append(String.valueOf(UniqueId.genId()));
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		buf.append("><");
		buf.append(this.getExecutor());
		buf.append("><");
		buf.append(this.getSystemId());
		buf.append("><");
		buf.append(this.getType());
		buf.append("><");
		buf.append(getContent());
		buf.append(">");
		return buf.toString();
	}
}
